package seueniumfordemoiselle.seleniumsimplify.pages.cadastro;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.CacheLookup;
import org.openqa.selenium.support.FindBy;

import seueniumfordemoiselle.seleniumsimplify.pages.BasePage;
import seueniumfordemoiselle.seleniumsimplify.pages.list.UFListPage;

public class CadastroPage extends BasePage {
	
	@CacheLookup
	@FindBy(xpath="//a[contains(text(),'Inserir')]")
	private WebElement linkInserir;
	@CacheLookup
	@FindBy(xpath="//a[contains(text(),'Voltar')]")
	private WebElement linkVoltar;
	@CacheLookup
	@FindBy(xpath="//a[contains(text(),'Alterar')]")
	private WebElement linkAlterar;
	@CacheLookup
	@FindBy(xpath="//a[contains(text(),'Apagar')]")
	private WebElement linkApagar;

	public CadastroPage(WebDriver driver) {
		super(driver);	
	}
	
	public UFListPage clicarLinkInserir(){
		this.getLinkInserir().click();
		
		return new UFListPage(this.getDriver());		
	}
	
	public UFListPage clicarLinkVoltar(){
		this.getLinkVoltar().click();	
		return new UFListPage(this.getDriver());
	}
	
	public UFListPage clicarLinkAlterar(){
		this.getLinkAlterar().click();
		return new UFListPage(this.getDriver());
	}
	
	public UFListPage clicarLinkApagar(){
		this.getLinkApagar().click();
		return new UFListPage(this.getDriver());
	}

	public WebElement getLinkInserir() {
		return linkInserir;
	}

	public void setLinkInserir(WebElement linkInserir) {
		this.linkInserir = linkInserir;
	}

	public WebElement getLinkVoltar() {
		return linkVoltar;
	}

	public void setLinkVoltar(WebElement linkVoltar) {
		this.linkVoltar = linkVoltar;
	}

	public WebElement getLinkAlterar() {
		return linkAlterar;
	}

	public void setLinkAlterar(WebElement linkAlterar) {
		this.linkAlterar = linkAlterar;
	}

	public WebElement getLinkApagar() {
		return linkApagar;
	}

	public void setLinkApagar(WebElement linkApagar) {
		this.linkApagar = linkApagar;
	}
}